﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Parameters.aspx.cs" Inherits="Admin_Parameters"
    Title="Parameters" MasterPageFile="~/Shared/DefaultMaster.master" %>

<%@ Register Assembly="Microsoft.Practices.Web.UI.WebControls" Namespace="Microsoft.Practices.Web.UI.WebControls"
    TagPrefix="pp" %>
<asp:Content ID="content" ContentPlaceHolderID="DefaultContent" Runat="Server">
		<h3>
            Administraci&oacute;n de Parametros</h3>
    <p>
        <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManagerParameters" runat="server">
        </ajaxToolkit:ToolkitScriptManager>
    <pp:ObjectContainerDataSource ID="ParametersContainerDataSource" runat="server" DataObjectTypeName="Metro.Admin.BusinessEntities.Parameter" OnDeleted="ParametersContainerDataSource_Deleted" OnInserted="ParametersContainerDataSource_Inserted" OnUpdated="ParametersContainerDataSource_Updated"/></p>
    <p>
        <b>
            <asp:LinkButton ID="lblExceptions" runat="server"></asp:LinkButton></b></p>
    
        <table>
            <tr>
                <td style="width: 100px">
                    <asp:Label ID="lblOpenSpot" runat="server" Text="Hora Apertura Spot:" Width="93px"></asp:Label></td>
                <td style="width: 100px">
                    <asp:TextBox ID="txtOpenSpot" runat="server" Width="70px" ValidationGroup="Factory"></asp:TextBox>
                    <ajaxToolkit:MaskedEditExtender ID="openSpotMaskedEditExtender" runat="server" TargetControlID="txtOpenSpot" AcceptAMPM="True" AutoComplete="False" ClipboardEnabled="False" Mask="99:99" MaskType="Time">
                    </ajaxToolkit:MaskedEditExtender>
                </td>
                <td style="width: 100px">
                    <asp:Label ID="lblCloseSpot" runat="server" Text="Hora de Cierre Spot:"></asp:Label></td>
                <td style="width: 92px">
                    <asp:TextBox ID="txtCloseSpot" runat="server" Width="70px"></asp:TextBox>
                    <ajaxToolkit:MaskedEditExtender ID="closeSpotMaskedEditExtender" runat="server" TargetControlID="txtCloseSpot" AcceptAMPM="True" AutoComplete="False" ClipboardEnabled="False" Mask="99:99" MaskType="Time">
                    </ajaxToolkit:MaskedEditExtender>
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                    <asp:Label ID="lblOpenNextDay" runat="server" Text="Hora Apertura Next Day:"></asp:Label></td>
                <td style="width: 100px">
                    <asp:TextBox ID="txtOpenNextDay" runat="server" ValidationGroup="Factory" Width="70px"></asp:TextBox>
                    <ajaxToolkit:MaskedEditExtender ID="openNextDayMaskedEditExtender" runat="server" TargetControlID="txtOpenNextDay" AcceptAMPM="True" AutoComplete="False" ClipboardEnabled="False" Mask="99:99" MaskType="Time">
                    </ajaxToolkit:MaskedEditExtender>
                </td>
                <td style="width: 100px">
                    <asp:Label ID="lblCloseNextDay" runat="server" Text="Hora de Cierre Next Day:"></asp:Label></td>
                <td style="width: 92px">
                    <asp:TextBox ID="txtCloseNextDay" runat="server" ValidationGroup="Factory" Width="70px"></asp:TextBox>
                    <ajaxToolkit:MaskedEditExtender ID="closeNextDayMaskedEditExtender" runat="server" TargetControlID="txtCloseNextDay" AcceptAMPM="True" AutoComplete="False" ClipboardEnabled="False" Mask="99:99" MaskType="Time">
                    </ajaxToolkit:MaskedEditExtender>
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                    <asp:Label ID="lblMinPrice" runat="server" Text="Precio M&iacute;nimo:"></asp:Label></td>
                <td style="width: 100px">
                    <asp:TextBox ID="txtMinPrice" runat="server" ValidationGroup="Factory" Width="70px"></asp:TextBox>
                    <ajaxToolkit:MaskedEditExtender ID="minPriceMaskedEditExtender" runat="server" TargetControlID="txtMinPrice" AutoComplete="False" ClipboardEnabled="False" DisplayMoney="Left" Mask="9,999.99" MaskType="Number">
                    </ajaxToolkit:MaskedEditExtender>
                </td>
                <td style="width: 100px">
                    <asp:Label ID="lblMaxPrice" runat="server" Text="Precio M&aacute;ximo:"></asp:Label></td>
                <td style="width: 92px">
                    <asp:TextBox ID="txtMaxPrice" runat="server" ValidationGroup="Factory" Width="70px"></asp:TextBox>
                    <ajaxToolkit:MaskedEditExtender ID="maxPriceMaskedEditExtender" runat="server" TargetControlID="txtMaxPrice" AutoComplete="False" ClipboardEnabled="False" DisplayMoney="Left" Mask="9,999.99" MaskType="Number">
                    </ajaxToolkit:MaskedEditExtender>
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                    <asp:Label ID="lblMinAmount" runat="server" Text="Monto M&iacute;nimo:"></asp:Label></td>
                <td style="width: 100px">
                    <asp:TextBox ID="txtMinAmount" runat="server" ValidationGroup="Factory"></asp:TextBox>
                    <ajaxToolkit:MaskedEditExtender ID="minAmountMaskedEditExtender" runat="server" TargetControlID="txtMinAmount" AutoComplete="False" ClipboardEnabled="False" DisplayMoney="Left" Mask="999,999,999,999,999,999" MaskType="Number">
                    </ajaxToolkit:MaskedEditExtender>
                </td>
                <td style="width: 100px">
                    <asp:Label ID="lblMaxAmount" runat="server" Text="Monto M&aacute;ximo:"></asp:Label></td>
                <td style="width: 92px">
                    <asp:TextBox ID="txtMaxAmount" runat="server" ValidationGroup="Factory"></asp:TextBox>
                    <ajaxToolkit:MaskedEditExtender ID="maxAmountMaskedEditExtender" runat="server" TargetControlID="txtMaxAmount" AutoComplete="False" ClipboardEnabled="False" DisplayMoney="Left" Mask="999,999,999,999,999,999" MaskType="Number">
                    </ajaxToolkit:MaskedEditExtender>
                </td>
            </tr>
            <tr>
                <td style="width: 100px; height: 67px;">
                    <asp:Label ID="lblTaxBase" runat="server" Text="Base IVA:"></asp:Label></td>
                <td style="width: 100px; height: 67px;">
                    <asp:TextBox ID="txtTaxBase" runat="server" ValidationGroup="Factory" Width="70px"></asp:TextBox>
                    <ajaxToolkit:MaskedEditExtender ID="taxBaseMaskedEditExtender" runat="server" TargetControlID="txtTaxBase" AutoComplete="False" ClipboardEnabled="False" DisplayMoney="Left" Mask="9,999.99" MaskType="Number">
                    </ajaxToolkit:MaskedEditExtender>
                </td>
                <td style="width: 100px; height: 67px;">
                    <asp:Label ID="lblVigencia" runat="server" Text="Vigencia Expiracion:"></asp:Label></td>
                <td style="width: 92px; height: 67px;">
                    <asp:TextBox ID="txtExpiration" runat="server" Width="50px"></asp:TextBox>
                    <ajaxToolkit:MaskedEditExtender ID="expirationMaskedEditExtender" runat="server"
                        ClipboardEnabled="False" Mask="99" MaskType="Number" TargetControlID="txtExpiration">
                    </ajaxToolkit:MaskedEditExtender>
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                    <asp:Label ID="lblTaxPercentage" runat="server" Text="% de IVA"></asp:Label></td>
                <td style="width: 100px">
                    <asp:TextBox ID="txtTaxPercentage" runat="server"></asp:TextBox>
                    <ajaxToolkit:MaskedEditExtender ID="taxPercentageMaskedEditExtender" runat="server"
                        ClipboardEnabled="False" Mask="99" MaskType="Number" TargetControlID="txtTaxPercentage">
                    </ajaxToolkit:MaskedEditExtender>
                </td>
                <td style="width: 100px">
                    <asp:CheckBox ID="chbSuspend" runat="server" Text="Suspender Plataforma" ValidationGroup="Factory" /></td>
                <td style="width: 92px">
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                </td>
                <td style="width: 100px">
                    <asp:Button ID="btnUpdate" runat="server" Text="Actualizar" OnClick="btnUpdate_Click" /></td>
                <td style="width: 100px">
                </td>
                <td style="width: 92px">
                </td>
            </tr>
        </table>
     <p>
        <b>Agregar nuevo parametro</b></p>
    <p>
       <asp:DetailsView ID="ParameterInsert" runat="server" DataSourceID="ParametersContainerDataSource"
            DefaultMode="Insert" Height="50px" Width="125px" AutoGenerateRows="False" GridLines="None">
            <Fields>
                <asp:BoundField DataField="Name" HeaderText="Nombre" SortExpression="Name" />
                <asp:BoundField DataField="Value" HeaderText="Valor" SortExpression="Value" />
                <asp:CommandField ButtonType="Button" InsertText="Agregar" ShowCancelButton="False" ShowInsertButton="True" />
            </Fields>
        </asp:DetailsView>
        </p>
    <p>
        <b>Lista de nuevo&nbsp; parametros</b></p>
    <p>
        <asp:GridView ID="ParametersGridView" runat="server" DataSourceID="ParametersContainerDataSource" AutoGenerateColumns="False" BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1" GridLines="None" DataKeyNames="Name">
            <Columns>
                <asp:CommandField ShowEditButton="True" ShowDeleteButton="True" ButtonType="Image" CancelImageUrl="~/images/cross.png" DeleteImageUrl="~/images/delete.png" EditImageUrl="~/images/pencil.png" UpdateImageUrl="~/images/tick.png"/>
                <asp:BoundField DataField="Name" HeaderText="Nombre" SortExpression="Name" ReadOnly="True"/>
                <asp:BoundField DataField="Value" HeaderText="Valor" SortExpression="Value"/>
                <asp:BoundField DataField="Type" HeaderText="Tipo" SortExpression="Type" ReadOnly="True"/>
            </Columns>
            <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
            <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
            <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
            <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
        </asp:GridView>
        </p>
    <p>
    </p>
</asp:Content>
